package com.justgame.project.service.just.service;

import com.justgame.project.service.api.dto.JustGameTypeMapDTO;
import com.justgame.project.cloud.common.entity.PageRequest;
import com.justgame.project.service.just.mapper.JustGameTypeMapMapper;
import com.justgame.project.service.api.vo.JustGameTypeMapVO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional(rollbackFor = Exception.class)
@AllArgsConstructor
public class JustGameTypeMapService {

    private final JustGameTypeMapMapper gameTypeMapMapper;


    public PageRequest<JustGameTypeMapVO> getList(PageRequest pageRequest, JustGameTypeMapDTO dto) {
        pageRequest.startPage();
        return pageRequest.BuildPageInfo(gameTypeMapMapper.getList(dto));
    }

    public Boolean save(JustGameTypeMapDTO dto) {
        return gameTypeMapMapper.Insert(dto) > 0;
    }

    public Boolean Delete(JustGameTypeMapDTO dto) {
        return gameTypeMapMapper.Delete(dto) > 0;
    }

}
